<html>
	<head>
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
		<link rel=StyleSheet href="styles.css" type="text/css">
		<script type="text/javascript">
			<!--
				function loadPage() {
					var json = <%= request.getAttribute("result") %>;
			
					document.getElementById("ItemID").innerHTML = decode(json["ItemID"]);
					document.getElementById("ItemName").innerHTML = decode(json["ItemName"]);
					document.getElementById("BuyPrice").innerHTML = decode(json["BuyPrice"]);
					document.getElementById("CreditCard").value = decode(json["CreditCard"]);
				}
				
				function decode(s) {
					return s.replace(/&amp;quot;/g, "\"")
							.replace(/&apos;/g, "\'")
							.replace(/&amp;/, "&")
							.replace(/&lt;/, "<")
							.replace(/&gt;/, ">")
							.replace(/\n/, "<br />");
				}
				
				// http://www.cambiaresearch.com/articles/39/how-can-i-use-javascript-to-allow-only-numbers-to-be-entered-in-a-textbox
				function isNumberKey(evt)
				{
					var charCode = (evt.which) ? evt.which : event.keyCode
					if (charCode > 31 && (charCode < 48 || charCode > 57))
						return false;

					return true;
				}
				// End code from http://www.cambiaresearch.com/articles/39/how-can-i-use-javascript-to-allow-only-numbers-to-be-entered-in-a-textbox
			-->
		</script>
		
		<title>Pay Now</title>
	</head>
	
	<body id="body" onLoad="loadPage()">
		<div id="item_info">
			<table class="text">
				<tr><td width="100">ItemID:</td><td><span id="ItemID" /></td></tr>
				<tr><td width="100">ItemName:</td><td><span id="ItemName" /></td></tr>
				<tr><td width="100">BuyPrice:</td><td><span id="BuyPrice" /></td></tr>
				<form action="https://localhost:8443/eBay/creditinfo" method="POST" name="payNowButton">
					<tr><td width="100">Credit Card:</td><td><input id="CreditCard" name="cc" type="text" onKeyPress="return isNumberKey(event)"/></td></tr>
					<tr><td></td><td><input name="paynowButton" type="submit" value="Pay Now"/></td></tr>
				</form>
			</table>
		</div>
	</body>
</html>
